﻿<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>js秒数转为日期格式(原创) -jq22.com</title>
<script src="https://libs.baidu.com/jquery/2.1.4/jquery.min.js"></script>
<style>
</style>
</head>
<body>
<div id="show"></div>

<script>
function getFormatDuringTime(during) {
    var s = Math.floor(during / 1) % 60;
    during = Math.floor(during / 60);
    var i = during % 60;
    during = Math.floor(during / 60);
    var h = during % 24;
    during = Math.floor(during / 24);
    var d = during;
    return d + '天' + h + '时' + i + '分' + s + '秒';
}

document.querySelector('#show').innerHTML = getFormatDuringTime(1532664);
</script>

</body>
</html>
